Skip to content

Restrict trigger push branch for GitHub Workflow#677

Merged
ok2c merged 1 commit into
apache:masterfrom
apupier:restrictTriggerPushForGithubWorkflows
Jul 3, 2026
Merged

Restrict trigger push branch for GitHub Workflow#677
ok2c merged 1 commit into
apache:masterfrom
apupier:restrictTriggerPushForGithubWorkflows

Conversation

@apupier

@apupier apupier commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Feature branches rarely need their own CI runs: the code is already tested when a pull request is opened against a release branch. If the push trigger has no branch restriction and pull_request is also configured, every push to a branch with an open PR runs the workflow twice: once for the push and once for the PR synchronisation.

Always give the push trigger an explicit list of branches: this stops branches created from a release branch from inheriting its workflow runs.

see https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=430408443#GitHubActionsRecommendedPractices-Restrictthepushtriggertospecificbranches

Feature branches rarely need their own CI runs: the code is already
tested when a pull request is opened against a release branch. If the
push trigger has no branch restriction and pull_request is also
configured, every push to a branch with an open PR runs the workflow
twice: once for the push and once for the PR synchronisation.

Always give the push trigger an explicit list of branches: this stops
branches created from a release branch from inheriting its workflow
runs.

see https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=430408443#GitHubActionsRecommendedPractices-Restrictthepushtriggertospecificbranches

Signed-off-by: Aurélien Pupier <apupier@ibm.com>
@ok2c ok2c merged commit fcdb530 into apache:master Jul 3, 2026
10 checks passed
@ok2c

ok2c commented Jul 3, 2026

Copy link
Copy Markdown
Member

@apupier Do you think could also contribute a similar change-set for HttpClient repository?

@apupier apupier deleted the restrictTriggerPushForGithubWorkflows branch July 3, 2026 06:48
@apupier

apupier commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@apupier Do you think could also contribute a similar change-set for HttpClient repository?

I provided one here apache/httpcomponents-client#843 , or you mean another repository?

@ok2c

ok2c commented Jul 3, 2026

Copy link
Copy Markdown
Member

@apupier My bad. I did not see it. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants